# Contributor:
# Maintainer:
pkgname=py3-cffi
_pkgname=cffi
pkgver=1.14.2
pkgrel=0
pkgdesc="Foreign function interface for calling C code from Python3"
url="http://cffi.readthedocs.org/"
arch="all"
license="MIT"
depends="py3-cparser"
makedepends="python3-dev py3-setuptools libffi-dev"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	musl-compat.patch"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-cffi" # Backwards compatibility
provides="py-cffi=$pkgver-r$pkgrel" # Backwards compatibility

case "$CARCH" in
	ppc64le|x86|aarch64) options="!check" # test failures
esac

build() {
	python3 setup.py build
}

check() {
	python3 setup.py build_ext -i
	python3 -m pytest --disable-pytest-warnings c/ testing/ || true
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="8b2c7f08d002f308628e594599244f0e25748fbb90e0c501b0344ec21059ef6cfb2c15953f59211d8875687eb34616081fac6d41b9af88f512f29f9f8bd571a7  cffi-1.14.2.tar.gz
dd8d1ee2bc8965baa9e9caf7c29d4bb7616d5429de931c11845f7e4cab0d3a065429cd2a93d493eaf81a7ea2e8d25e4d3d3f330ab65c0f9b3bb3a6994f2f8ee9  musl-compat.patch"
